<pdf>
    <dynamic-page page-size="a4">
        <placeholders>
            <header>
                <div height="230">
                    <table>
                        <tr>
                            <td height="110" border-type="none"></td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td  text-align="center" width="20%" border-type="none" font-style="bold" font-size="14px"  height="25">
                                DEVIS
                            </td>
                            <td  text-align="center" width="50%" border-type="none" height="25">
                            </td>
                            <td border-type="none" font-style="bold" font-size="12px" height="25">
                                {{devis.client}}
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td  text-align="center" width="20%" font-style="bold" font-size="14px" border-type="none" height="30">
                                {{ numero }}
                            </td>
                            <td  text-align="center" width="50%" border-type="none" height="30">
                            </td>
                            <td border-type="none" height="30">
                                {{devis.client.matriculeFiscale}}
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td height="5" border-type="none"></td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td  text-align="center" width="30%" border-type="none" height="35">
                                {{ devis.date|date('d/m/Y') }}  {{devis.getTime}}
                            </td>
                            <td  text-align="center" width="40%" border-type="none" height="30">
                            </td>
                            <td border-type="none" height="30">
                                {{devis.client.adresse}}
                            </td>
                        </tr>
                    </table>
                </div>
            </header>
            <footer>
                <div height="180">
                    <table>
                        <tr>
                            <td  border-type="none" height="25"></td>
                        </tr>
                    </table>
                    <table width="100%">
                        <tr >
                            <td  border-type="none" height="15" width="85%"></td>
                            <td  border-type="none" height="15">
                                                    {{total_brut|number_format(3)}}
                            </td>
                        </tr>
                    </table>    
                    <table width="100%">
                        <tr >
                            <td  border-type="none" height="13" width="17%"></td>
                            <td  border-type="none" height="13" width="68%">
                                Devis
                            </td>
                            <td  border-type="none" height="13">
                                                    {{remise|number_format(3)}}
                            </td>
                        </tr>
                    </table>
                    <table width="100%">
                        <tr >
                            <td  border-type="none" height="13" width="85%">
                                                            {{ montant_lettre }}
                            </td>
                            <td  border-type="none" height="13">
                                                    {{total_ht|number_format(3)}}
                            </td>
                        </tr>
                    </table>
                    <table width="100%">
                        <tr >
                            <td  border-type="none" height="13" width="85%"></td>
                            <td  border-type="none" height="13">
                                                    {{total_tva|number_format(3)}}
                            </td>
                        </tr>
                    </table>        
                    <table width="100%">
                        <tr >
                            <td  border-type="none" height="13" width="85%"></td>
                            <td  border-type="none" height="13">

                            </td>
                        </tr>
                    </table>   
                    <table width="100%">
                        <tr >
                            <td  border-type="none" height="13" width="85%"></td>
                            <td  border-type="none" height="13">
                                                    {{total_ttc|number_format(3)}}
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td height="30" border-type="none"></td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td border-type="none" width="90%"></td>
                            <td border-type="none">
                        <page-info offset="0" format="page %s/%s" />
                        </td>
                        </tr>
                    </table>
                </div>
            </footer>
        </placeholders>
        <div>

            {% for ligne in lignes %}
            <table width="100%">
                <tr>
                    <td width="15%" border-type="none" text-align="center" height="15">{{ ligne.article.reference }}</td>
                    <td width="35%" border-type="none" height="15">{{ ligne.article.designation }}</td>
                    <td width="8%" border-type="none" text-align="center" height="15">{{ ligne.quantite }}</td>
                    <td width="11%" border-type="none" text-align="center" height="15">{{ ligne.prixUnitaireHt|number_format(3) }}</td>
                    <td width="6%" border-type="none" text-align="center" height="15">{{ ligne.TauxTva|number_format(2) }}</td>
                    <td width="9%" border-type="none" text-align="center" height="15">{{ ligne.TauxRemise|number_format(2) }}</td>
                {% set montant_ht = ligne.prixUnitaireHt*ligne.quantite*(1-ligne.TauxRemise/100) %}
                    <td border-type="none" text-align="center" height="15">{{ montant_ht|number_format(3) }}</td>
                </tr>
            </table>
            {% endfor %}    

        </div>
    </dynamic-page>
</pdf>